<?
	$params[sid] = $sid;
	$params[action] = "sales";
	$url = "$baseURL/?".encode_params($params);
	
	if ($errorMsg) {
	include_once('errorMsg.html');
	}
	if ($okMsg) {
	include_once('okMsg.html');
	}
?> 
<table width="500" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td><font class="text"><b><?=translate('view_payment_hist');?><br>
      <br>
      </b>
      <?=translate('view_payment_desc', array('rpURL' =>  BASE_URL));?>
      </font></td>
  </tr>
</table>
<br>
<?
//if(in_array($_SERVER['REMOTE_ADDR'],array('83.228.120.103','83.228.120.53','83.228.120.64'))){
	include('sales/payment_history.php');
	echo '<br>';
//}else{
//        include('sales/payment_history.php');
//	echo '<br><br><br>';                
//}

$res_table="
<table width=500 border=0 cellspacing=0 cellpadding=0>
 	<tr>
		<td>
Due to the different method of generation of the old and the new statistics, 
it is possible that some resellers will see different amounts in the two tables. 
In case you spot that your commissions' status in the old statistics is 'Not Paid' but in the new one it is not marked at all, 
you should contact immediately the ResellersPanel Sales Department with concrete details.
		</td>
	</tr>
</table><br>
<TABLE border=0 class='bTable' cellspacing='0' width='80%'>
        <TR>
                <Td colspan='5'>".translate('payment_history')."</Td>
        </TR>
        <tr>
                <th>".translate('period')."</th><th>".translate('credits')."</th><th colspan=2>".translate('issue_payment_date')."</th>
        </tr>";        
                $l1 =  list_payment_history($id,'period',"");
		if(!$l1){
			$res_table = '';
		}else{
			$res_table .= $l1.'</table>';
		}
/*
                //$l2 = list_payment_history($id,'unpayed_period',"");
                if(!$l1 && !$l2){
                        echo "<tr><td colspan='5' align='center'>none</td></tr>";
                }
                else {
					if($l1) echo $l1;
					if($l2) echo $l2;
				}

*/
echo $res_table;
?>

<br>
<table width="500" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td> 
      <p><font class="text"><b><br>
     <?=translate('payment_final_text');?>
</font></p>
      </td>
  </tr>
</table>
<p>&nbsp;</p>
